package com.design.pattern.state.business;

import com.design.pattern.state.base.CarState;
import com.design.pattern.state.base.StateEnum;
import org.springframework.stereotype.Component;

/**
 * @author 王霄
 * @date 2021/12/8 14:18
 **/
@Component
public class OpenCarState extends CarState {

    @Override
    public StateEnum getState() {
        return StateEnum.OPEN;
    }

    @Override
    public void close() {
        context.setCurrentState(stateManager.get(StateEnum.CLOSE));
        System.out.println("关门");
    }
}
